class AddInstructors < ActiveRecord::Migration
  
  @names = ['Nicole Cabrera', 'Jason Taylor', 'Christian Keur', 'Joaquin Estrada', 'Pierre Larochelle', 'Prasad Tetali', 'Bill Green', 'Joseph Ellis', 'Dan Brown', 'Matt Baker', 'Enid Steinbart', 'Joel Spolsky', 'Derek Merril', 'Sanjoy Dasgupta', 'Christos Papadimitriou', 'Umesh Vazirani', 'Donald Norman', 'Kennesh Rosen', 'Leonhard Euler','Carl Gauss', 'Bernhard Reinmann', 'Pierre Fermat', 'Rene Descartes', 'Georg Cantor', 'John Neumann', 'Augustin Cauchy', 'Blaise Pascal', 'David Hilbert', 'Henri Poincare', 'Isaac Newton', 'Gottfreid Leibniz', 'Joseph Lagrange', 'Srinivasa Ramanujan', 'Archimedes Syracuse', 'Euclid Alexandria', 'Richard Stallman', 'Linus Torvalds', 'Steve Jobs', 'Bill Gates', 'Jeff Bezos', 'Mark Zuckerberg', 'Melody Jackson', 'Bob Waters']
  
  def self.up
    max_department_id = Department.find(:all).last.id
    @names.each do |name|
      Instructor.create(:name => name, :email => name.sub(' ', '').underscore + '@gatech.edu', :department_id => rand(max_department_id)+1, :office_room => rand(999))
    end
  end

  def self.down
    @names.each do |name|
      Instructor.destroy_all "name = '#{name}'"
    end
  end
end
